< previous page page_517 next page >

Page 517
cutes only the next line of code in the procedure. By setting the next statement to execute, you choose which line executes next. To set the next statement to be executed, move the insertion point (cursor) to the line of code you want to execute as shown in Figure 18.11, and then choose Run, Continue from the menu.
12181-0517a.gif
Figure 18.11.
Moving the current statement pointer to set the next executable
statement in the code.
Also, if you have lost track of which statement will be executed next, you can use the Show Next Statement command from the Debug menu to place the cursor on the line that will execute next.
Watching Your Variables
During the debugging process, you may find that a calculation is not producing the results that you want, or problems might be occurring when a certain variable or property contains a particular value. As you have seen, many of the debugging problems are not immediately traceable to a single statement; this requires you to observe the behavior of the variable or expression throughout a procedure or the entire application. The Watch expression tools give you the capability to automatically monitor these variables and expressions in your application. When the application enters the Break mode, the Watch expressions that you specified will appear in the Watches window, where you can observe their values.
In addition, you can use a special version of a Watch expression to halt the execution of the application when a value or expression changes or equals a specified value. For example, if you want to see what a variable contains at a certain point in a loop, you could single-step through the loop until you reach the appropriate counter value, or you could put a Break expression on the loop counter for the value you want to stop at, and then run the application.

 
< previous page page_517 next page >

If you like this book, buy it!